package cn.itcast.controller.system;

import cn.itcast.controller.BaseController;
import cn.itcast.domain.system.SysLog;
import cn.itcast.service.system.SysLogService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/system/log")
public class SysLogController extends BaseController {

    @Autowired
    private SysLogService sysLogService;

    @RequestMapping(value = "/list",name ="查询所有日志数据")
    public String findAll(@RequestParam(defaultValue = "1",name = "page") int pageNum,@RequestParam(defaultValue = "10") int pageSize){
//        当前登录人所属部门的id
        PageInfo<SysLog> pageBean = sysLogService.findPage(getCompanyId(),pageNum,pageSize);
        request.setAttribute("page",pageBean);
        return "system/log/log-list";
    }
}
